package maitreEsclave;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import jeu.Game;


public class Agregation extends UnicastRemoteObject implements AgregationInterface{
   
	private static final long serialVersionUID = 1L;
	//private LinkedList<String> serveurs_prets;
   private long tpsdepart;
   
    public Agregation(long tpsdepart) throws RemoteException {
    	this.tpsdepart=tpsdepart;
	}

    public void agrege(Game g) throws RemoteException {
    	System.out.println("J'ai recu une reponse");
    	if (g.isWin()){
    		
    		g.printState();
    		long tpsfinenfants =System.currentTimeMillis()-tpsdepart;
    		System.out.println("un esclave a fini en "+tpsfinenfants);
    	}
    }
}

